package com.yl.chainStore.entity.warehouse

import com.baomidou.mybatisplus.annotation.IdType
import com.baomidou.mybatisplus.annotation.TableField
import com.baomidou.mybatisplus.annotation.TableId
import com.baomidou.mybatisplus.annotation.TableName
import com.yl.chainStore.common.enums.TypeEnum
import com.yl.common.getContext
import java.util.*

/**
 * <p>
 *  物品进出记录
 * </p>
 *
 * @author cxw
 * @since 2021-06-11
 */
@TableName("warehouse_good_update_log")
data class WarehouseGoodUpdateLog(

	/**
     *  id
     */
    @TableId(value = "id", type = IdType.AUTO)
    var id: Long = -1,

	/**
     * 关联type1，入库，2出库，3调拨入库，4调拨出库，5盘点添加，6盘点减少
     */
    @TableField("associated_type")
    var associatedType: TypeEnum,

	/**
     * 关联id
     */
    @TableField("associated_id")
    var associatedId: Long? = null,

	/**
     * 处理人（审核人）
     */
    @TableField("deal_user_id")
    var dealUserId: Long = getContext().userId,

	/**
     * 备注
     */
    @TableField("remark")
    var remark: String? = null,

	/**
     * 仓库id
     */
    @TableField("dept_id")
    var deptId: Long,

	/**
     * 创建时间
     */
    @TableField("create_time")
    var createTime: Date = Date(),


	/**
     * 公司
     */
    @TableField("company_id")
    var companyId: Long,

	/**
     * 物品id
     */
    @TableField("item_id")
    var itemId: Long,

	/**
     * 数量
     */
    @TableField("good_count")
    var goodCount: Int,

	/**
     * 原批次数量
     */
    @TableField("before_batch_count")
    var beforeBatchCount: Int? = null,

	/**
     * 修改后批次数量
     */
    @TableField("after_batch_count")
    var afterBatchCount: Int? = null,

	/**
     * 原总数
     */
    @TableField("before_sum_count")
    var beforeSumCount: Int? = null,

	/**
     * 修改后总数
     */
    @TableField("after_sum_count")
    var afterSumCount: Int? = null,


	@TableField("detail_id")
    var detailId: Long,

	@TableField("batch_count_id")
    var batchCountId:Long

    )
